package com.ethanJun.csdn.domain.model;


import com.ethanJun.csdn.utils.MarkdownConverter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import lombok.Data;

/**
 * @author xbhog
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ArticleToolRequest {

    @JsonProperty(required = true, value = "title")
    @JsonPropertyDescription("文章标题")
    private String title;

    @JsonProperty(required = true, value = "markdownContent")
    @JsonPropertyDescription("文章内容")
    private String markdownContent;

    @JsonProperty(required = true, value = "tags")
    @JsonPropertyDescription("文章标签，英文逗号隔开")
    private String tags;

    @JsonProperty(required = true, value = "description")
    @JsonPropertyDescription("文章简述")
    private String description;

    public String getContent() {
        return MarkdownConverter.convertToHtml(markdownContent);
    }

}
